<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>纸牌游戏</title>
</head>
<body>
<script>
    let cards = [];
                  //红桃 梅花  方块  黑桃
    for(let suit of ['H','C','D','S']){
        for(let value = 1;value <14;value++){
            cards.push({
                suit,
                value
            })
        }
    }
    // cards.map(cardobj =>{
    //     console.log(cardobj);
    // });

    //找到所有2的纸牌
    cards.map(card2 =>{
        if(card2.value === 2){
            console.log(card2);
        }
    });
    console.log("---------------------------");
    //找到所有方块
    cards.map(cardD =>{
        if(cardD.suit === 'D'){
            console.log(cardD);
        }
    });
    console.log("---------------------------");
    //找到所有花色牌
    cards.map(cardH =>{
        if(cardH.value === 11 || cardH.value === 12 || cardH.value === 13){
            console.log(cardH);
        }
    });
    console.log("---------------------------");
    //找到所有红桃的花色牌
    cards.map(cardHT =>{
        if((cardHT.suit === 'H' && cardHT.value === 11) || (cardHT.suit === 'H' &&cardHT.value === 12) || (cardHT.suit === 'H' &&cardHT.value === 13)){
            console.log(cardHT);
        }
    });

</script>
</body>
</html>